﻿@{
    Layout = null;
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>信达税务师事务所客户信息查询系统-登录</title>
<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/themes/default.css")">
	<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/themes/default/easyui.css")">
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/font-awesome-4.5.0/css/font-awesome.min.css")">
    <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/themes/icon.css")">
</head>

<body>
<div id="loginWin" class="login_window">
    <div class="easyui-layout" style="width:600px;height:260px;padding:5px; display:inline-block; margin:0 auto">
      <div data-options="region:'north',border:false" style="background:#51627E;padding:10px">
          <span style="padding-left:10px; font-size:20px; color:White; font-weight:bold"><i class="fa fa-cubes light-grey"></i>信达税务师事务所客户信息查询系统</span>
      </div> 
      <div region="center" border="false" style="padding:5px;background:#fff;text-align:center">
          <div style="width:500px;height:100px;padding:10px; margin:0 auto">
                <form id="loginForm" method="post">
                    <div style="margin-bottom:10px">
			            <input class="easyui-textbox" name="login" style="width:230px;height:35px;padding:12px" data-options="prompt:'用户名',iconCls:'icon-man',iconWidth:38">
		            </div>
		            <div style="margin-bottom:20px">
			            <input class="easyui-textbox" name="password" type="password" style="width:230px;height:35px;padding:12px" data-options="prompt:'密码',iconCls:'icon-lock',iconWidth:38">
		            </div>                    
                </form>  
          </div>
          <div style="text-align:center">
                <a class="easyui-linkbutton" iconCls="e-icon fa fa-sign-in fa-lg green" href="javascript:void(0)" style="padding:5px 0px;width:100px" onclick="login()">
                    <span style="font-size:14px;">登录</span>
                </a>
                <a class="easyui-linkbutton" iconCls="e-icon fa fa-remove fa-lg red" href="javascript:void(0)" style="padding:5px 0px;width:100px" onclick="cleardata()">
                    <span style="font-size:14px;">重置</span>
                </a>
          </div>
       </div>
            <div region="south" border="false" style="text-align:center;padding:5px 0; background:#F0F0F0">
                 <div style="color:#000; text-align:center; margin:0px; padding:0px;"><i class="fa fa-copyright light-grey"></i>&nbsp;信达税务师事务所</div>
            </div>
    </div>
</div>
</body>
<script type="text/javascript" src="@Url.Content("~/scripts/jquery.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/scripts/jquery.easyui.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/scripts/locale/easyui-lang-zh_CN.js")"></script>
<script type="text/javascript">
    document.onkeydown = function (e) {
        var event = e || window.event;
        var code = event.keyCode || event.which || event.charCode;
        if (code == 13) {
            login();
        }
    }
    $(function () {
        $("input[name='login']").focus();
    });
    function cleardata() {
        $('#loginForm').form('clear');
    }
    function login() {
        if ($("input[name='login']").val() == "" || $("input[name='password']").val() == "") {
            $.messager.alert("错误","用户名或密码为空，请输入",'error');
            $("input[name='login']").focus();
        } else {
            //ajax异步提交
        $.ajax({
            type: "POST",   //post提交方式默认是get
            url: "Home/Login",
            data: $("#loginForm").serialize(),   //序列化               
            error: function (request) {      // 设置表单提交出错                 
                $("#showMsg").html(request);  //登录错误提示信息
            },
            success: function (data) {
                var msg = eval('(' + data + ')');
                if (msg.success) {
                    document.location = "Main";
                }
                else {
                    $.messager.alert('错误', msg.msg, 'error');
                }
            }
        });
        }
    }
</script>
</html>